.class final Lcom/melesta/engine/FacebookOperations$9;
.super Ljava/lang/Object;
.source "FacebookOperations.java"

# interfaces
.implements Lcom/facebook/Request$Callback;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/melesta/engine/FacebookOperations;->facebookGetGroupInfo(Ljava/lang/String;II)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation


# instance fields
.field final synthetic val$callback:I

.field final synthetic val$group_id:Ljava/lang/String;

.field final synthetic val$me:Lcom/melesta/engine/EngineActivity;

.field final synthetic val$user_data:I


# direct methods
.method constructor <init>(Lcom/melesta/engine/EngineActivity;Ljava/lang/String;II)V
    .locals 0
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 635
    iput-object p1, p0, Lcom/melesta/engine/FacebookOperations$9;->val$me:Lcom/melesta/engine/EngineActivity;

    iput-object p2, p0, Lcom/melesta/engine/FacebookOperations$9;->val$group_id:Ljava/lang/String;

    iput p3, p0, Lcom/melesta/engine/FacebookOperations$9;->val$user_data:I

    iput p4, p0, Lcom/melesta/engine/FacebookOperations$9;->val$callback:I

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onCompleted(Lcom/facebook/Response;)V
    .locals 9
    .parameter "response"

    .prologue
    .line 639
    :try_start_0
    invoke-virtual {p1}, Lcom/facebook/Response;->getError()Lcom/facebook/FacebookRequestError;

    move-result-object v1

    .line 640
    .local v1, facebookError:Lcom/facebook/FacebookRequestError;
    if-eqz v1, :cond_3

    const/4 v3, 0x1

    .line 641
    .local v3, isErrorState:Z
    :goto_0
    if-nez v3, :cond_0

    .line 642
    invoke-virtual {p1}, Lcom/facebook/Response;->getGraphObject()Lcom/facebook/model/GraphObject;

    move-result-object v2

    .line 643
    .local v2, graphObject:Lcom/facebook/model/GraphObject;
    if-eqz v2, :cond_4

    .line 644
    const-string v7, "id"

    invoke-interface {v2, v7}, Lcom/facebook/model/GraphObject;->getProperty(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v7

    sput-object v7, Lcom/melesta/engine/FacebookOperations;->mFacebookPageId:Ljava/lang/String;

    .line 645
    const-string v7, "name"

    invoke-interface {v2, v7}, Lcom/facebook/model/GraphObject;->getProperty(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v7

    sput-object v7, Lcom/melesta/engine/FacebookOperations;->mFacebookPageName:Ljava/lang/String;

    .line 646
    const-string v7, "link"

    invoke-interface {v2, v7}, Lcom/facebook/model/GraphObject;->getProperty(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v7

    sput-object v7, Lcom/melesta/engine/FacebookOperations;->mFacebookPageLink:Ljava/lang/String;

    .line 647
    const-string v7, "likes"

    invoke-interface {v2, v7}, Lcom/facebook/model/GraphObject;->getProperty(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v7

    const/4 v8, -0x1

    invoke-static {v7, v8}, Lcom/melesta/engine/Helpers;->goGetIntValue(Ljava/lang/Object;I)I

    move-result v5

    .line 648
    .local v5, likes:I
    const-string v7, "picture"

    invoke-interface {v2, v7}, Lcom/facebook/model/GraphObject;->getProperty(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lorg/json/JSONObject;

    .line 649
    .local v4, jo:Lorg/json/JSONObject;
    const-string v7, "data"

    invoke-virtual {v4, v7}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v7

    const-string v8, "url"

    invoke-virtual {v7, v8}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    .line 651
    .local v6, pic:Ljava/lang/String;
    iget-object v7, p0, Lcom/melesta/engine/FacebookOperations$9;->val$me:Lcom/melesta/engine/EngineActivity;

    new-instance v8, Lcom/melesta/engine/FacebookOperations$9$1;

    invoke-direct {v8, p0, v5, v6}, Lcom/melesta/engine/FacebookOperations$9$1;-><init>(Lcom/melesta/engine/FacebookOperations$9;ILjava/lang/String;)V

    invoke-virtual {v7, v8}, Lcom/melesta/engine/EngineActivity;->runOnGLThread(Ljava/lang/Runnable;)V

    .line 664
    .end local v2           #graphObject:Lcom/facebook/model/GraphObject;
    .end local v4           #jo:Lorg/json/JSONObject;
    .end local v5           #likes:I
    .end local v6           #pic:Ljava/lang/String;
    :cond_0
    :goto_1
    if-eqz v3, :cond_2

    .line 665
    if-eqz v1, :cond_1

    .line 666
    const-string v7, "engine"

    invoke-virtual {v1}, Lcom/facebook/FacebookRequestError;->getErrorType()Ljava/lang/String;

    move-result-object v8

    invoke-static {v7, v8}, Lcom/melesta/engine/Log;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 667
    const-string v7, "engine"

    invoke-virtual {v1}, Lcom/facebook/FacebookRequestError;->getErrorMessage()Ljava/lang/String;

    move-result-object v8

    invoke-static {v7, v8}, Lcom/melesta/engine/Log;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 670
    :cond_1
    iget-object v7, p0, Lcom/melesta/engine/FacebookOperations$9;->val$me:Lcom/melesta/engine/EngineActivity;

    new-instance v8, Lcom/melesta/engine/FacebookOperations$9$2;

    invoke-direct {v8, p0}, Lcom/melesta/engine/FacebookOperations$9$2;-><init>(Lcom/melesta/engine/FacebookOperations$9;)V

    invoke-virtual {v7, v8}, Lcom/melesta/engine/EngineActivity;->runOnGLThread(Ljava/lang/Runnable;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 688
    .end local v1           #facebookError:Lcom/facebook/FacebookRequestError;
    .end local v3           #isErrorState:Z
    :cond_2
    :goto_2
    return-void

    .line 640
    .restart local v1       #facebookError:Lcom/facebook/FacebookRequestError;
    :cond_3
    const/4 v3, 0x0

    goto :goto_0

    .line 660
    .restart local v2       #graphObject:Lcom/facebook/model/GraphObject;
    .restart local v3       #isErrorState:Z
    :cond_4
    const/4 v3, 0x1

    goto :goto_1

    .line 678
    .end local v1           #facebookError:Lcom/facebook/FacebookRequestError;
    .end local v2           #graphObject:Lcom/facebook/model/GraphObject;
    .end local v3           #isErrorState:Z
    :catch_0
    move-exception v0

    .line 679
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/melesta/engine/Error;->processException(Ljava/lang/Exception;)V

    .line 680
    iget-object v7, p0, Lcom/melesta/engine/FacebookOperations$9;->val$me:Lcom/melesta/engine/EngineActivity;

    new-instance v8, Lcom/melesta/engine/FacebookOperations$9$3;

    invoke-direct {v8, p0}, Lcom/melesta/engine/FacebookOperations$9$3;-><init>(Lcom/melesta/engine/FacebookOperations$9;)V

    invoke-virtual {v7, v8}, Lcom/melesta/engine/EngineActivity;->runOnGLThread(Ljava/lang/Runnable;)V

    goto :goto_2
.end method
